package com.xinbochuang.machine.admin.controller.macroom;


import com.xinbochuang.machine.admin.domain.macRoom.UlocationStatic;
import com.xinbochuang.machine.admin.service.macRoom.IUlocationService;
import com.xinbochuang.machine.common.domain.TableDataInfo;
import com.xinbochuang.machine.framework.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author 杜文博
 * @date 2020-09-08
 */
@RestController
@RequestMapping("/ulocation")
public class UlocationController {
    @Autowired
    private IUlocationService iUlocationService;

    /**
     * 通过机柜姓名查询机柜
     *
     * @return
     */
//    @GetMapping("/getUlocationMacRoom")
//    public TableDataInfo getUlocationMacRoom(UlocationStatic ulocationStatic) {
//        return iUlocationService.getUlocationMacRoom(ulocationStatic);
//    }
    /**
     * 通过机柜姓名查询机柜
     *
     * @return
     */
    @GetMapping("/getUlocationMacRoom")
    public TableDataInfo getUlocationMacRoom(UlocationStatic ulocationStatic) {
        return iUlocationService.getUlocationMacRoomNew(ulocationStatic);
    }
    /**
     * 通过机柜姓名查询机柜
     *
     * @return
     */
    @GetMapping("/getUlocationStatic")
    public TableDataInfo getUlocationStatic(UlocationStatic ulocationStatic) {
        return iUlocationService.getUlocationStatic(ulocationStatic);
    }

    /**
     * 通过机柜姓名查询机柜
     *
     * @return
     */
    @GetMapping("/getUlocationMacRoomChart")
    public AjaxResult getUlocationMacRoomByChart(UlocationStatic ulocationStatic) {
        Map<String, Object> result = iUlocationService.getUlocationMacRoomByChart(ulocationStatic);
        return AjaxResult.data(result);
    }

    /**
     * 机房u位统计
     */
    @GetMapping("/uLocaiontCount")
    public AjaxResult uLocaiontCount() {
        return AjaxResult.data(iUlocationService.uLocaiontCount());
    }
}

